import java.util.Scanner;

/**
 * 玩家类
 * */
public class Player {
    private int levelNo; // 玩家当前级别号
    private int currScore;//玩家当前级别积分
    private long startTime;//当前级别开始时间
    private int elapsedTime;//当前级别已用时间

    public Player(){

    }

    public Player(int levelNo, int currScore, long startTime, int elapsedTime) {
        this.levelNo = levelNo;
        this.currScore = currScore;
        this.startTime = startTime;
        this.elapsedTime = elapsedTime;
    }

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurrScore() {
        return currScore;
    }

    public void setCurrScore(int currScore) {
        this.currScore = currScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public void play(){
        Scanner scanner = new Scanner(System.in);
       // Player player = new Player(2,3,23,12);
        // Game game = new Game(player);
         Game game= new Game(this);
        for (int i = 0; i <LevelParam.levels.length ; i++) {
            levelNo +=1;
            startTime=System.currentTimeMillis();//没升级一次都会获取一个新的开始时间
            //每个级别循环对应的次数
            for (int j = 0; j <LevelParam.levels[levelNo-1].getStrTimes() ; j++) {
                   String out=game.printStr();
                   String in=scanner.next();
                   game.printResult(out,in);
            }

        }
    }
}
